import request from "@/apps/admin/units/request";

import {HttpResultData} from "@/types/project";

/**
 * 获取任务信息
 */
export const getCrontabListApi = (): Promise<HttpResultData<any>> => request(`/system-crontab/list`)

/**
 * 获取任务信息
 * @param where
 */
export const getCrontabLogListApi = (where: { [key: string]: any }): Promise<HttpResultData<any>> => request(`/system-crontab/log`, where)

/**
 * 获取任务信息
 * @param name
 */
export const runCrontabApi = (name: string): Promise<HttpResultData<any>> => request(`/system-crontab/run`, {name}, 'POST')